<template>
  <div>
    <el-dialog v-model="dialogVisible" width="80%" align-center :show-close="false" destroy-on-close draggable>
      <template #header="{ close }">
        <div class="dialog-header flex justify-between items-center">
          <div>审核</div>
          <el-icon class="el-icon--left cursor-pointer" @click="close">
            <CircleCloseFilled color="#fff" />
          </el-icon>
        </div>
      </template>
      <ClaimInfo :row="rowInfo" />
      <template #footer>
        <div class="dialog-footer">
          <Checkcomponents :procInsId="procInsId" class="mt-[10px]" @success="hanldCancel" />
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
import Checkcomponents from "@/views/flowable/processInstance/detail/components.vue";
import ClaimInfo from "./ClaimInfo.vue";
import { getList} from "@/api/fee/rz/xmrzbl/index.js";
const dialogVisible = ref(false);
const rowInfo = ref({});
const procInsId = ref(null); //流程实例id
//查看
const check = async (claimid,processId) => {
  await initInfo(claimid);
  dialogVisible.value = true;
  procInsId.value = processId;
};
// 基础信息
const initInfo = async (claimid)=>{
    let params = {id:claimid,pageNum:1,pageSize:10};
    try {
        const res = await getList(params);
        if (res.code == 200) {
          rowInfo.value = res.rows[0];  
        }
    }catch (error) {
        console.log(error);
    }
}

defineExpose({ check });

const hanldCancel = ()=>{
  dialogVisible.value = false;
  emit("save-success");
}
const emit = defineEmits(["save-success"]);
</script>

<style scoped lang="scss">
@import url("@/views/fee/index.scss");
:deep(.el-dialog__body) {
  height: calc(100% - 180px);
}
</style>
